<include file="public/layout"/>
<style>
    .te_le .dataTables_paginate{float: left;}
    .bot{float: right;padding: 15px 0}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div class="page" style="padding: 0px 1% 0 1%;">
    <!-- 操作说明 -->
    <div class="flexigrid">

        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr>
                    	<th abbr="ac_id" axis="col4" class="" align="left">
                            <div style="text-align: left; width: 50px;" class="">ID</div>
                        </th>
                        
                        <th abbr="article_title" axis="col3" class="" align="left">
                            <div style="text-align: center; width: 150px;" class="">昵称</div>
                        </th>
                        
                        <th abbr="article_time" axis="col6" class="" align="left">
                            <div style="text-align: left; width: 100px;" class="">角色</div>
                        </th>
						<th abbr="ac_id" axis="col4" class="" align="left">
                            <div style="text-align: center; width: 100px;" class="">电话</div>
                       </th>
					   <th align="left" abbr="article_title" axis="col6" class="">
			                <div style="text-align: left; width:150px;" class="">操作</div>
			           </th> 
						
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table>
                    <tbody id="goos_table">
                    <volist name="ulist" id="list">
                        <tr>
                            <td align="center" axis="col0">
				              <div style="width: 50px;">{$list.userid}</div>
				            </td>                
							
							<td align="center" axis="col0">
				              <div style="text-align: center; width: 150px;">{$list.username}</div>
				            </td> 
				            
				            <td align="center" axis="col0">
				            	<if condition="$list.role eq 2">
				              		<div style="text-align: center; width: 100px; color: #FF2222;font-weight: bold;">( {$rtype[$list.role]} )</div>
				             	</if>
				             	<if condition="$list.role eq 1">
				             		<div style="text-align: center; width: 100px;">{$rtype[$list.role]}</div>
				             	</if>
				            </td>
		
							<td align="center" axis="col0">
				              <div style="text-align: center; width: 100px;">{$list.phone}</div>
				            </td> 
							
							<td align="center" class="handle">
			                  <div style="text-align: center; width: 150px;">                    
			                    <a class="btn red" onClick="transfer('{$userid}','{$uname}','{$list.username}',this)" data-url="{:U('Storebossinfo/transfer')}" data-id="{$list.userid}"><i class="fa fa-trash-o"></i>转移用户</a>
			                  </div>
			                </td>
	
                            <td class="" style="width: 100%;" align="">
                                <div>&nbsp;</div>
                            </td>
                        </tr>

                    </volist>
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>

    </div>
</div>
<script>
		function transfer(userid,username,tname,obj){
			layer.confirm('您确定将 <span style="color:red;"> '+username+'</span> 的用户全部转移给 <span style="color:red;"> '+tname+'</span> 吗?', {
    		  btn: ['确定','取消'] //按钮
    		}, function(){
    		    // 确定
   				$.ajax({
   					type : 'post',
   					url : $(obj).attr('data-url'),
   					data : {uid:userid,tuid:$(obj).attr('data-id')},
   					dataType : 'json',
   					success : function(data){
						layer.closeAll();
   						if(data.status==1){
                            layer.msg(data.msg, {icon: 1, time: 2000},function(){
                                location.href = '';
//                                $(obj).parent().parent().parent().remove();
                            });
   						}else{
   							layer.msg(data.msg, {icon: 2,time: 3000});
   						}
   					}
   				})
    		}, function(index){
    			layer.close(index);
    			return false;// 取消
    		}
    	);
		}
</script>
</body>
</html>